PaginationResult

data class PaginationResult<T>(    val page: Int,     val size: Int,     val results: List<T>,     val objectsNumber: Long) : Pagination

Parameters

page

Current page number

size

Current page size. It can be greater than size of results

results

Result objects

objectsNumber

Count of all objects across all pages

Constructors

Link copied to clipboard
fun <T> PaginationResult(    page: Int,     results: List<T>,     pagesNumber: Int,     size: Int)
Link copied to clipboard
fun <T> PaginationResult(    page: Int,     size: Int,     results: List<T>,     objectsNumber: Long)

Functions

Link copied to clipboard
open operator fun contains(value: Int): Boolean
Link copied to clipboard
open fun isEmpty(): Boolean

Properties

Link copied to clipboard
open override val endInclusive: Int
Link copied to clipboard
val objectsNumber: Long
Link copied to clipboard
open override val page: Int
Link copied to clipboard
val pagesNumber: Int

Amount of pages for current pagination

Link copied to clipboard
val results: List<T>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val start: Int

Extensions

changeResults
Link copied to clipboard
fun <I, O> PaginationResult<I>.changeResults(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResults(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResults(data: List<O>): PaginationResult<O>
changeResultsUnchecked
Link copied to clipboard
fun <I, O> PaginationResult<I>.changeResultsUnchecked(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResultsUnchecked(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResultsUnchecked(data: List<O>): PaginationResult<O>
currentPageIfNotEmpty
Link copied to clipboard
inline fun <T> PaginationResult<T>.currentPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.currentPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.currentPageIfNotEmpty(): PaginationResult<T>?
nextPageIfNotEmpty
Link copied to clipboard
inline fun PaginationResult<*>.nextPageIfNotEmpty(): SimplePagination?
inline fun PaginationResult<*>.nextPageIfNotEmpty(): SimplePagination?
inline fun PaginationResult<*>.nextPageIfNotEmpty(): SimplePagination?
thisPageIfNotEmpty
Link copied to clipboard
inline fun <T> PaginationResult<T>.thisPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.thisPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.thisPageIfNotEmpty(): PaginationResult<T>?